package com.casic.ops.entity.vo;

import com.casic.ops.consts.Const;
import com.orion.utils.convert.TypeStore;
import com.orion.vcs.git.info.BranchInfo;
import lombok.Data;

/**
 * @ClassName ops-platform
 * @Description  app分支信息
 * @Author mianbin
 * @Date 2022/5/31 10:59
 * @Version 1.0
 **/
@Data
public class ApplicationVcsBranchVO {

    /**
     * 名称
     */
    private String name;

    /**
     * 是否为默认
     *
     * @see Const#IS_DEFAULT
     */
    private Integer isDefault;

    public static ApplicationVcsBranchVO BranchInfo2vcsBranchVO(BranchInfo p) {
        ApplicationVcsBranchVO vo = new ApplicationVcsBranchVO();
        vo.setName(p.toString());
        return vo;
    }

    static {
        TypeStore.STORE.register(BranchInfo.class, ApplicationVcsBranchVO.class, p -> {
            ApplicationVcsBranchVO vo = new ApplicationVcsBranchVO();
            vo.setName(p.toString());
            return vo;
        });
    }
}
